import { IType } from '@/interface';
import { $get, $post, $put, $delete } from '@/request/api';

export function fetchTypeList(params) {
  return $get('/type/list', params);
}

export function fetchCreateType(data: IType) {
  return $post('/type/create', data);
}
export function fetchUpdateType(data: IType) {
  return $put(`/type/update/${data.id}`, data);
}
export function fetchDeleteType(id: number) {
  return $delete(`/type/delete/${id}`);
}
